-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pyface Color Class and Trait Type #534
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this looks good. There's potentially a bug with wx dialog and then some minor comments re typos and missing tests.
Co-authored-by: Ieva <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #534 +/- ##
==========================================
+ Coverage 37.08% 39.11% +2.03%
==========================================
Files 470 485 +15
Lines 26027 26788 +761
Branches 3961 4075 +114
==========================================
+ Hits 9652 10479 +827
+ Misses 15948 15861 -87
- Partials 427 448 +21
Continue to review full report at Codecov.
|
Pending CI passing, this should be ready for re-review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qt dialog now works well, but wx dialog still doesn't
I think this is ready for one more go-around with review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still having issues with wx dialog window freezing, but I don't think it's related to this PR. I'm seeing the same behaviour with other wx dialogs as well (using both 4.0.7 and 4.1.0)
Another thing is that wx dialogs for me appear without "OK" or "Close" buttons, the only way to close the dialog is via system's "x" button, which behaves differently between qt and wx (see in-code comment). The same dialog without buttons appears using TraitsUI color editor, so again, I don't think it is related to this PR specifically, but maybe it's something that can be fixed here.
Edit: Here's the issue I opened for ColorEditor_demo.py
enthought/traitsui#946. I get the same dialog using get_color
function from this PR.
Note: if nobody else is seeing these issues, it might be that the state of GUI machinery might be messed up on my computer. In that case please ignore the comments.
if result == OK: | ||
return dialog.color |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing the dialog via system's "x" button returns the color that was passed to this function when using wx. With qt it returns None
as expected.
Everything in here has now been pulled out into a separate PR. |
This builds on #520 to create a
Color
class and correspondingPyfaceColor
trait to represent a color in a toolkit independent way. It also includes aColorDialog
class built on top of these classes.Together with #520 this resolves #476.
This should not be merged until #520 is merged. This requires features from Traits 6.1.